<template>
  <div>
    <li>
      <span>{{ goods.shopName }}&nbsp;&nbsp;</span>
      <button @click="countPrev">+</button>
      <span>&nbsp;&nbsp;{{ goods.count }}&nbsp;&nbsp;</span>
      <button @click="countNext">-</button>
    </li>
  </div>
</template>

<script>
export default {
  name: "BuyFoodAddconst",
  props: ["goods"],
  data() {
    return {
    };
  },

  mounted() {},

  methods: {
      countPrev(){
         return this.goods.count++
      },
      countNext(){
          if(this.goods.count<=0){
              return this.goods.count=0
          }
         return this.goods.count--
      }
  },
};
</script>

<style>
button {
  width: 20px;
  vertical-align: middle;
  line-height: 20px;
}
</style>